package top.laoshuzi.scad.mosinnagant

import top.laoshuzi.scad.mosinnagant.config.Scad
import top.laoshuzi.scad.mosinnagant.config.ScadConfig
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.bolt
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPin
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPinTube
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPinTubeBottom
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPinTubeBottomGroove
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPinTubeInGroove
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.firingPinTubeTop
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.triggerBottom
import top.laoshuzi.scad.mosinnagant.utils.MosinNagant.triggerTop
import top.laoshuzi.scad.mosinnagant.utils.ScadConstants
import top.laoshuzi.scad.mosinnagant.utils.ex.*

/**
 * Created by mouse on 2019/7/19.
 */
fun main() {
    val scad = Scad(ScadConfig(ScadConstants.outDir, ScadConstants.scadName))

    val firingPin = firingPin()

    val bolt = bolt()
        .Rz(90.0)
        .Tz(-19.0)

    val firingPinTubeBottom = firingPinTubeBottom()
        .Ty(10.0)

    val firingPinTubeTop = firingPinTubeTop()
        .Ty(-10.0)

    val triggerTop = triggerTop()
        .Rz(9.0)
//        .Rz(18.0)
        .Txyz(-10.0, -1.0, 0.0)
    val triggerBottom = triggerBottom()
        .Rz(-19.0)
//        .Rz(-30.0)
        .Txyz(-10.0, -1.0, 0.0)
        .Txyz(-0.75, -2.25, 0.0)


    //todo test
    val firingPinTube = firingPinTube()
        .Tx(10.0)
    val firingPinTubeInGroove = firingPinTubeInGroove()
        .Tx(20.0)
    val firingPinTubeBottomGroove = firingPinTubeBottomGroove()
        .Tx(30.0)


    scad.generate(
//        firingPin,
//        bolt,
//        firingPinTubeTop,
//        firingPinTubeBottom,
        triggerTop,
        triggerBottom,
        //todo test
//        firingPinTube,
//        firingPinTubeBottomGroove,
        firingPinTubeInGroove
    )

}

